<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="/pages/template/template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">

	<ui:define name="pageTitle">Web Chat</ui:define>

	<ui:define name="conteudo">
		<t:saveState value="#{chatBean.pessoaVisivel}" />
		<t:saveState value="#{chatBean.mensagem}" />
		<a4j:poll interval="3000"  reRender="chat" />
					
		<fieldset>
			<legend>Chat</legend>
				<div class="linhaTipoA center">
					<h:outputLabel style="principal tamanho45" value="Nome do cliente: " >
						<h:outputText style="tamanho50" value="#{chatBean.dialogoTO.cliente.nome}" />
					</h:outputLabel>
					<h:outputLabel style="principal tamanho45" value="Nome do atendente: " >
						<h:outputText style="tamanho50" value="#{chatBean.dialogoTO.funcionario.nome}" />
					</h:outputLabel>		
				</div>
			
				<div class="linhaTipoA center">
					<h:inputTextarea  id="chat" value="#{chatBean.conteudoChat}"  readonly="true" 
					cols="80" rows="20"/>		
				</div>
				<br />

			<div class="linhaTipoA center">
				<h:inputText id="msg" value="#{chatBean.mensagem}" style="tamanho70"/>
				<h:commandButton style="botaoPrincipal"   tabindex="0"
					actionListener="#{chatBean.enviarMensagem}"  value="Enviar"/>
				
			</div>
			
		</fieldset>
		
		
		<div class="boxBotoes">
			<h:commandButton value="Cancelar" styleClass="botaoSecundario"
				action="cancelar" />
		</div>
	</ui:define>
</ui:composition>